﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using FrmMain;

namespace MyKTVService
{
   public class AdminService

    {


        Dao dao = new Dao();
        /// <summary>
      /// 查询管理员登录结果
      /// </summary>
      /// <param name="text1"></param>
      /// <param name="text2"></param>
      /// <returns></returns>
      /// 
        public bool DoLogin(string text1, string text2)
        {
            string sql = string.Format(@"select count(1) from admin_info where admin_name = @admin_name and admin_pwd=@admin_pwd");
            SqlParameter[] parame = { new SqlParameter("@admin_name", text1),new SqlParameter("@admin_pwd", text2)};
            if (Convert.ToInt32(dao.DoScalar(sql, parame)) > 0) {
                return true;
            }
            return false;
        }
    }
}
